package com.yz.group1.group_1.controller;

import com.yz.group1.group_1.entity.AppointmentTime;
import com.yz.group1.group_1.service.AppointmentTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/appointment/time")
public class AppointmentTimeController {

    @Autowired
    private AppointmentTimeService appointmentTimeService;

    // 按医生ID查询可预约时段
    @GetMapping("/byDoctor")
    public List<AppointmentTime> getByDoctorId(@RequestParam Integer doctorId) {
        return appointmentTimeService.getByDoctorId(doctorId);
    }
}